package com.wtwd.device.dao;


import com.wtwd.device.model.entity.AppUserTotal;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author mjy
 * @date 2021/10/20
 * @description
 */
@Mapper
public interface AppUserTotalMapper {

    AppUserTotal getAppUserTotalByUserId(@Param("userId") Long userId);

    Integer insert(AppUserTotal appUserTotal);

    Integer updateStepTotal(@Param("userId") Long userId,@Param("stepTotal") Integer stepTotal);

    Integer updateCaloriesTotal(@Param("userId") Long userId, @Param("caloriesTotal") Integer caloriesTotal);

    Integer updateRunTotal(@Param("userId") Long userId,@Param("runTotal") Integer runTotal);

    Integer updateRidingTotal(@Param("userId") Long userId, @Param("ridingTotal") Integer ridingTotal);

    @Delete("delete from app_user_total where user_id =#{userId}")
    int deleteByUser(@Param("userId") Long userId);
}
